function plot_xy(x_file, x_col, x_label, x_px, ...
                 y_file, y_col, y_label, y_px, ...
                 axis_bounds, out_file)
% Plot x-y scatter plot from given files.
% For x_file abs path to load(.)-compatible file with data in columns.
% For x_col 1-based index into columns of x_file to plot.
% For y_file like x_file with same number of rows.
% For y_col 1-based index into columns of y_file to plot.
% For out_file = absolute path to output file (eps).

x_data = load(x_file);
y_data = load(y_file);

x = x_data(:, x_col);
y = y_data(:, y_col);

size(x)
size(y)

figure
plot(x, y, 'k.')
if ~isempty(axis_bounds)
  axis(axis_bounds)
end
xlabel(strrep(x_label,'_',' '))
ylabel(strrep(y_label,'_',' '))
set(gcf, 'PaperPositionMode', 'auto', ...
         'Resize', 'off', ...
         'Position', [0 0 x_px y_px]);
print('-deps', out_file);

end
